function resaults = spektrEquiv_Element(Z, q, q0)

% Parameters
accuracy = 0.001;

% initial thickness of element
thickness = 0;
min = 0;
max = 100;

exp_target = spektrExposure(q);
q_min = spektrBeers(q0, [Z, max]);
exp_min = spektrExposure(q_min);
while exp_min > exp_target
    min = max;
    max = 2 * max;
    q_min = spektrBeers(q0, [Z, max]);
    exp_min = spektrExposure(q_min);
end

exp_temp = spektrExposure(q0);

while(exp_temp > exp_target * (1 + accuracy)) || (exp_temp < exp_target * (1 - accuracy))

    %incrementing the thickness of the filter

    thickness = (min + max)/2;

    %   generate spectrum given a elemental filter of a specified thickness
    q_temp = spektrBeers(q0, [Z, thickness]);

    %   calculate the exposure of the spectrum
    exp_temp = spektrExposure(q_temp);

    if exp_temp < exp_target
        max = thickness;
    elseif exp_temp > exp_target
        min = thickness;
    end
end
resaults = thickness;
end